package com.ruoyi.youtian.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.youtian.mapper.FaultNotifyAnnounceUserMapper;
import com.ruoyi.youtian.domain.FaultNotifyAnnounceUser;
import com.ruoyi.youtian.service.IFaultNotifyAnnounceUserService;
import com.ruoyi.common.core.text.Convert;

/**
 * 报警公告消息阅读记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-12-08
 */
@Service
public class FaultNotifyAnnounceUserServiceImpl implements IFaultNotifyAnnounceUserService 
{
    @Autowired
    private FaultNotifyAnnounceUserMapper faultNotifyAnnounceUserMapper;

    /**
     * 查询报警公告消息阅读记录
     * 
     * @param id 报警公告消息阅读记录主键
     * @return 报警公告消息阅读记录
     */
    @Override
    public FaultNotifyAnnounceUser selectFaultNotifyAnnounceUserById(Long id)
    {
        return faultNotifyAnnounceUserMapper.selectFaultNotifyAnnounceUserById(id);
    }

    /**
     * 查询报警公告消息阅读记录列表
     * 
     * @param faultNotifyAnnounceUser 报警公告消息阅读记录
     * @return 报警公告消息阅读记录
     */
    @Override
    public List<FaultNotifyAnnounceUser> selectFaultNotifyAnnounceUserList(FaultNotifyAnnounceUser faultNotifyAnnounceUser)
    {
        return faultNotifyAnnounceUserMapper.selectFaultNotifyAnnounceUserList(faultNotifyAnnounceUser);
    }

    /**
     * 新增报警公告消息阅读记录
     * 
     * @param faultNotifyAnnounceUser 报警公告消息阅读记录
     * @return 结果
     */
    @Override
    public int insertFaultNotifyAnnounceUser(FaultNotifyAnnounceUser faultNotifyAnnounceUser)
    {
        faultNotifyAnnounceUser.setCreateTime(DateUtils.getNowDate());
        return faultNotifyAnnounceUserMapper.insertFaultNotifyAnnounceUser(faultNotifyAnnounceUser);
    }

    /**
     * 修改报警公告消息阅读记录
     * 
     * @param faultNotifyAnnounceUser 报警公告消息阅读记录
     * @return 结果
     */
    @Override
    public int updateFaultNotifyAnnounceUser(FaultNotifyAnnounceUser faultNotifyAnnounceUser)
    {
        return faultNotifyAnnounceUserMapper.updateFaultNotifyAnnounceUser(faultNotifyAnnounceUser);
    }

    @Override
    public int updateFaultNotifyAnnounceReadStatus(FaultNotifyAnnounceUser faultNotifyAnnounceUser){
        return  faultNotifyAnnounceUserMapper.updateFaultNotifyAnnounceReadStatus(faultNotifyAnnounceUser);
    }

    /**
     * 批量删除报警公告消息阅读记录
     * 
     * @param ids 需要删除的报警公告消息阅读记录主键
     * @return 结果
     */
    @Override
    public int deleteFaultNotifyAnnounceUserByIds(String ids)
    {
        return faultNotifyAnnounceUserMapper.deleteFaultNotifyAnnounceUserByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除报警公告消息阅读记录信息
     * 
     * @param id 报警公告消息阅读记录主键
     * @return 结果
     */
    @Override
    public int deleteFaultNotifyAnnounceUserById(Long id)
    {
        return faultNotifyAnnounceUserMapper.deleteFaultNotifyAnnounceUserById(id);
    }
}
